<template>
  <div>
    <header class="head">多路分发配置</header>
    <el-form label-width="100px">
      <el-form-item label="并行分发：">
        <el-checkbox
          v-model="formData.parallel_processing"
          :disabled="isView"
        ></el-checkbox>
      </el-form-item>
      <el-form-item label="异常停止：">
        <el-checkbox
          v-model="formData.stop_on_exception"
          :disabled="isView"
        ></el-checkbox>
        <span style="font-size: 12px; margin-left: 10px">仅串行时有效</span>
      </el-form-item>
      <el-form-item label="超时(毫秒)：">
        <el-input
          v-model="formData.timeout"
          :disabled="isView"
          type="number"
          style="width: 50%"
        />
        <span style="font-size: 12px">（-1表示一直等待）</span>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "custom-distribute",
  props: {
    fbOptions: {
      type: Object,
      default: () => {
      }
    },
  },
  computed: {
    formData: {
      get() {
        return this.fbOptions.flow.moreNodeInfo[this.fbOptions.flow.currentNodeId] || {};
      },
      set(val) {
        this.fbOptions.flow.moreNodeInfo = {
          ...this.fbOptions.flow.moreNodeInfo,
          [this.fbOptions.flow.currentNodeId]:val|| {},
        }
      },
    },
    isView() {
      return (
        this.fbOptions.operationType === "view"
      );
    },
  },
};
</script>

<style lang="scss" scoped>
.head {
  height: 40px;
  text-align: center;
  line-height: 40px;
  color: #333;
  font-weight: bold;
  font-size: 14px;
  background-color: #ccc;
  margin-bottom: 16px;
}
:deep(.el-form-item) {
  margin-bottom: 0px;
}
</style>
